package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.kaishengit.dao.core.BaseDao;
import com.kaishengit.pojo.Category;
@Repository
public class CategoryDao extends BaseDao<Category,Integer>{

	@SuppressWarnings("unchecked")
	public List<Category> findAllByForeignKeyIdAndAbout(int userid,String about) {
		Criteria cri  = getSession().createCriteria(Category.class);
		cri.add(Restrictions.eq("userid", userid));
		cri.add(Restrictions.eq("about", about));
		return cri.list();
	}

}
